package com.egao.common.module.cms.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 栏目
 * @author pyx
 */
@ApiModel(description = "栏目")
@TableName("cms_category")
@Data
public class Category implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("原id")
    private String oldId;

    @ApiModelProperty("父级编号")
    private Integer parentId;

    @ApiModelProperty("原父级编号")
    private String oldParentId;

    @ApiModelProperty("栏目名称")
    private String name;

    @ApiModelProperty("栏目类型  1.标准栏目  2.链接栏目 3.详情栏目")
    private String type;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("链接地址")
    private String linkUrl;

    @ApiModelProperty("首页显示  0.正常状态  1.首页显示")
    private String homeFlag;

    @ApiModelProperty("是否有首页图 0.否  1.是")
    private String homeImg;

    @ApiModelProperty("栏目说明")
    private String content;

    @ApiModelProperty("添加时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createTime;

    @ApiModelProperty("编辑时间")
    private Date updateTime;

    @ApiModelProperty("是否删除 0否 1是")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("当前对象栏目下的集合")
    @TableField(exist = false)
    private List<Category> children;
}
